# 封装base64 pickle
import base64,pickle
class CookieSecret(object):
    #加密
    @classmethod
    def dumps(cls,data):
        pickle_bytes = pickle.dumps(data)
        encode_base_64 = base64.b64encode(pickle_bytes)
        return encode_base_64.decode()

    #解密
    @classmethod
    def loads(cls,data):
        decode_base_64 = base64.b64decode(data)
        pickle_data = pickle.loads(decode_base_64)
        return pickle_data